






--  quartz自带表结构
delete from qrtz_fired_triggers;
delete from qrtz_simple_triggers;
delete from qrtz_simprop_triggers;
delete from qrtz_cron_triggers;
delete from qrtz_blob_triggers;
delete from qrtz_triggers;
delete from qrtz_job_details;
delete from qrtz_calendars;
delete from qrtz_paused_trigger_grps;
delete from qrtz_locks;
delete from qrtz_scheduler_state;

drop table qrtz_calendars;
drop table qrtz_fired_triggers;
drop table qrtz_blob_triggers;
drop table qrtz_cron_triggers;
drop table qrtz_simple_triggers;
drop table qrtz_simprop_triggers;
drop table qrtz_triggers;
drop table qrtz_job_details;
drop table qrtz_paused_trigger_grps;
drop table qrtz_locks;
drop table qrtz_scheduler_state;


CREATE TABLE qrtz_job_details
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  JOB_NAME  VARCHAR2(200) NOT NULL,
  JOB_GROUP VARCHAR2(200) NOT NULL,
  DESCRIPTION VARCHAR2(250) NULL,
  JOB_CLASS_NAME   VARCHAR2(250) NOT NULL,
  IS_DURABLE VARCHAR2(1) NOT NULL,
  IS_NONCONCURRENT VARCHAR2(1) NOT NULL,
  IS_UPDATE_DATA VARCHAR2(1) NOT NULL,
  REQUESTS_RECOVERY VARCHAR2(1) NOT NULL,
  JOB_DATA BLOB NULL,
  CONSTRAINT QRTZ_JOB_DETAILS_PK PRIMARY KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
);
CREATE TABLE qrtz_triggers
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  TRIGGER_NAME VARCHAR2(200) NOT NULL,
  TRIGGER_GROUP VARCHAR2(200) NOT NULL,
  JOB_NAME  VARCHAR2(200) NOT NULL,
  JOB_GROUP VARCHAR2(200) NOT NULL,
  DESCRIPTION VARCHAR2(250) NULL,
  NEXT_FIRE_TIME NUMBER(13) NULL,
  PREV_FIRE_TIME NUMBER(13) NULL,
  PRIORITY NUMBER(13) NULL,
  TRIGGER_STATE VARCHAR2(16) NOT NULL,
  TRIGGER_TYPE VARCHAR2(8) NOT NULL,
  START_TIME NUMBER(13) NOT NULL,
  END_TIME NUMBER(13) NULL,
  CALENDAR_NAME VARCHAR2(200) NULL,
  MISFIRE_INSTR NUMBER(2) NULL,
  JOB_DATA BLOB NULL,
  CONSTRAINT QRTZ_TRIGGERS_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  CONSTRAINT QRTZ_TRIGGER_TO_JOBS_FK FOREIGN KEY (SCHED_NAME,JOB_NAME,JOB_GROUP)
  REFERENCES QRTZ_JOB_DETAILS(SCHED_NAME,JOB_NAME,JOB_GROUP)
);
CREATE TABLE qrtz_simple_triggers
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  TRIGGER_NAME VARCHAR2(200) NOT NULL,
  TRIGGER_GROUP VARCHAR2(200) NOT NULL,
  REPEAT_COUNT NUMBER(7) NOT NULL,
  REPEAT_INTERVAL NUMBER(12) NOT NULL,
  TIMES_TRIGGERED NUMBER(10) NOT NULL,
  CONSTRAINT QRTZ_SIMPLE_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  CONSTRAINT QRTZ_SIMPLE_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
);
CREATE TABLE qrtz_cron_triggers
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  TRIGGER_NAME VARCHAR2(200) NOT NULL,
  TRIGGER_GROUP VARCHAR2(200) NOT NULL,
  CRON_EXPRESSION VARCHAR2(120) NOT NULL,
  TIME_ZONE_ID VARCHAR2(80),
  CONSTRAINT QRTZ_CRON_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  CONSTRAINT QRTZ_CRON_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
);
CREATE TABLE qrtz_simprop_triggers
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  TRIGGER_NAME VARCHAR2(200) NOT NULL,
  TRIGGER_GROUP VARCHAR2(200) NOT NULL,
  STR_PROP_1 VARCHAR2(512) NULL,
  STR_PROP_2 VARCHAR2(512) NULL,
  STR_PROP_3 VARCHAR2(512) NULL,
  INT_PROP_1 NUMBER(10) NULL,
  INT_PROP_2 NUMBER(10) NULL,
  LONG_PROP_1 NUMBER(13) NULL,
  LONG_PROP_2 NUMBER(13) NULL,
  DEC_PROP_1 NUMERIC(13,4) NULL,
  DEC_PROP_2 NUMERIC(13,4) NULL,
  BOOL_PROP_1 VARCHAR2(1) NULL,
  BOOL_PROP_2 VARCHAR2(1) NULL,
  CONSTRAINT QRTZ_SIMPROP_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  CONSTRAINT QRTZ_SIMPROP_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
);
CREATE TABLE qrtz_blob_triggers
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  TRIGGER_NAME VARCHAR2(200) NOT NULL,
  TRIGGER_GROUP VARCHAR2(200) NOT NULL,
  BLOB_DATA BLOB NULL,
  CONSTRAINT QRTZ_BLOB_TRIG_PK PRIMARY KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP),
  CONSTRAINT QRTZ_BLOB_TRIG_TO_TRIG_FK FOREIGN KEY (SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
  REFERENCES QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP)
);
CREATE TABLE qrtz_calendars
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  CALENDAR_NAME  VARCHAR2(200) NOT NULL,
  CALENDAR BLOB NOT NULL,
  CONSTRAINT QRTZ_CALENDARS_PK PRIMARY KEY (SCHED_NAME,CALENDAR_NAME)
);
CREATE TABLE qrtz_paused_trigger_grps
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  TRIGGER_GROUP  VARCHAR2(200) NOT NULL,
  CONSTRAINT QRTZ_PAUSED_TRIG_GRPS_PK PRIMARY KEY (SCHED_NAME,TRIGGER_GROUP)
);
CREATE TABLE qrtz_fired_triggers
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  ENTRY_ID VARCHAR2(95) NOT NULL,
  TRIGGER_NAME VARCHAR2(200) NOT NULL,
  TRIGGER_GROUP VARCHAR2(200) NOT NULL,
  INSTANCE_NAME VARCHAR2(200) NOT NULL,
  FIRED_TIME NUMBER(13) NOT NULL,
  SCHED_TIME NUMBER(13) NOT NULL,
  PRIORITY NUMBER(13) NOT NULL,
  STATE VARCHAR2(16) NOT NULL,
  JOB_NAME VARCHAR2(200) NULL,
  JOB_GROUP VARCHAR2(200) NULL,
  IS_NONCONCURRENT VARCHAR2(1) NULL,
  REQUESTS_RECOVERY VARCHAR2(1) NULL,
  CONSTRAINT QRTZ_FIRED_TRIGGER_PK PRIMARY KEY (SCHED_NAME,ENTRY_ID)
);
CREATE TABLE qrtz_scheduler_state
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  INSTANCE_NAME VARCHAR2(200) NOT NULL,
  LAST_CHECKIN_TIME NUMBER(13) NOT NULL,
  CHECKIN_INTERVAL NUMBER(13) NOT NULL,
  CONSTRAINT QRTZ_SCHEDULER_STATE_PK PRIMARY KEY (SCHED_NAME,INSTANCE_NAME)
);
CREATE TABLE qrtz_locks
(
  SCHED_NAME VARCHAR2(120) NOT NULL,
  LOCK_NAME  VARCHAR2(40) NOT NULL,
  CONSTRAINT QRTZ_LOCKS_PK PRIMARY KEY (SCHED_NAME,LOCK_NAME)
);

create index idx_qrtz_j_req_recovery on qrtz_job_details(SCHED_NAME,REQUESTS_RECOVERY);
create index idx_qrtz_j_grp on qrtz_job_details(SCHED_NAME,JOB_GROUP);

create index idx_qrtz_t_j on qrtz_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
create index idx_qrtz_t_jg on qrtz_triggers(SCHED_NAME,JOB_GROUP);
create index idx_qrtz_t_c on qrtz_triggers(SCHED_NAME,CALENDAR_NAME);
create index idx_qrtz_t_g on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP);
create index idx_qrtz_t_state on qrtz_triggers(SCHED_NAME,TRIGGER_STATE);
create index idx_qrtz_t_n_state on qrtz_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
create index idx_qrtz_t_n_g_state on qrtz_triggers(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
create index idx_qrtz_t_next_fire_time on qrtz_triggers(SCHED_NAME,NEXT_FIRE_TIME);
create index idx_qrtz_t_nft_st on qrtz_triggers(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
create index idx_qrtz_t_nft_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
create index idx_qrtz_t_nft_st_misfire on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
create index idx_qrtz_t_nft_st_misfire_grp on qrtz_triggers(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);

create index idx_qrtz_ft_trig_inst_name on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME);
create index idx_qrtz_ft_inst_job_req_rcvry on qrtz_fired_triggers(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
create index idx_qrtz_ft_j_g on qrtz_fired_triggers(SCHED_NAME,JOB_NAME,JOB_GROUP);
create index idx_qrtz_ft_jg on qrtz_fired_triggers(SCHED_NAME,JOB_GROUP);
create index idx_qrtz_ft_t_g on qrtz_fired_triggers(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
create index idx_qrtz_ft_tg on qrtz_fired_triggers(SCHED_NAME,TRIGGER_GROUP);


/*
NAVICAT ORACLE DATA TRANSFER
ORACLE CLIENT VERSION : 11.2.0.4.0

SOURCE SERVER         : 127.0.0.1_1521_XE
SOURCE SERVER VERSION : 110200
SOURCE HOST           : 127.0.0.1:1521
SOURCE SCHEMA         : BPMS

TARGET SERVER TYPE    : ORACLE
TARGET SERVER VERSION : 110200
FILE ENCODING         : 65001

DATE: 2018-06-12 16:35:03
*/


-- ----------------------------
-- TABLE STRUCTURE FOR SCHEDULE_JOB
-- ----------------------------
CREATE TABLE  "SCHEDULE_JOB" (
"JOB_ID" NUMBER(20) NOT NULL ,
"BEAN_NAME" VARCHAR2(200) NULL ,
"METHOD_NAME" VARCHAR2(100) NULL ,
"PARAMS" NCLOB NULL ,
"CRON_EXPRESSION" VARCHAR2(100) NULL ,
"STATUS" NUMBER(4) NULL ,
"REMARK" VARCHAR2(255) NULL ,
"CREATE_TIME" DATE NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SCHEDULE_JOB" IS '定时任务';
COMMENT ON COLUMN  "SCHEDULE_JOB"."JOB_ID" IS '任务ID';
COMMENT ON COLUMN  "SCHEDULE_JOB"."BEAN_NAME" IS 'SPRING BEAN名称';
COMMENT ON COLUMN  "SCHEDULE_JOB"."METHOD_NAME" IS '方法名';
COMMENT ON COLUMN  "SCHEDULE_JOB"."PARAMS" IS '参数';
COMMENT ON COLUMN  "SCHEDULE_JOB"."CRON_EXPRESSION" IS 'CRON表达式';
COMMENT ON COLUMN  "SCHEDULE_JOB"."STATUS" IS '任务状态  0：正常  1：暂停';
COMMENT ON COLUMN  "SCHEDULE_JOB"."REMARK" IS '备注';
COMMENT ON COLUMN  "SCHEDULE_JOB"."CREATE_TIME" IS '创建时间';

-- ----------------------------
-- RECORDS OF SCHEDULE_JOB
-- ----------------------------
INSERT INTO  "SCHEDULE_JOB" VALUES ('1', 'TESTTASK', 'TEST', 'RENREN', '0 0/30 * * * ?', '0', '有参数测试', TO_DATE('2016-12-01 23:16:46', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB" VALUES ('2', 'TESTTASK', 'TEST2', NULL, '0 0/30 * * * ?', '1', '无参数测试', TO_DATE('2016-12-03 14:55:56', 'YYYY-MM-DD HH24:MI:SS'));

-- ----------------------------
-- TABLE STRUCTURE FOR SCHEDULE_JOB_LOG
-- ----------------------------
CREATE TABLE  "SCHEDULE_JOB_LOG" (
"LOG_ID" NUMBER(20) NOT NULL ,
"JOB_ID" NUMBER(20) NOT NULL ,
"BEAN_NAME" VARCHAR2(200) NULL ,
"METHOD_NAME" VARCHAR2(100) NULL ,
"PARAMS" NCLOB NULL ,
"STATUS" NUMBER(4) NOT NULL ,
"ERROR" NCLOB NULL ,
"TIMES" NUMBER(11) NOT NULL ,
"CREATE_TIME" DATE NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SCHEDULE_JOB_LOG" IS '定时任务日志';
COMMENT ON COLUMN  "SCHEDULE_JOB_LOG"."LOG_ID" IS '任务日志ID';
COMMENT ON COLUMN  "SCHEDULE_JOB_LOG"."JOB_ID" IS '任务ID';
COMMENT ON COLUMN  "SCHEDULE_JOB_LOG"."BEAN_NAME" IS 'SPRING BEAN名称';
COMMENT ON COLUMN  "SCHEDULE_JOB_LOG"."METHOD_NAME" IS '方法名';
COMMENT ON COLUMN  "SCHEDULE_JOB_LOG"."PARAMS" IS '参数';
COMMENT ON COLUMN  "SCHEDULE_JOB_LOG"."STATUS" IS '任务状态    0：成功    1：失败';
COMMENT ON COLUMN  "SCHEDULE_JOB_LOG"."ERROR" IS '失败信息';
COMMENT ON COLUMN  "SCHEDULE_JOB_LOG"."TIMES" IS '耗时(单位：毫秒)';
COMMENT ON COLUMN  "SCHEDULE_JOB_LOG"."CREATE_TIME" IS '创建时间';

-- ----------------------------
-- RECORDS OF SCHEDULE_JOB_LOG
-- ----------------------------
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('1', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1017', TO_DATE('2018-05-31 08:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('2', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1005', TO_DATE('2018-05-31 08:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('3', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1018', TO_DATE('2018-06-01 08:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('4', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1025', TO_DATE('2018-06-01 09:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('5', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1011', TO_DATE('2018-06-01 16:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('6', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1018', TO_DATE('2018-06-02 15:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('7', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1008', TO_DATE('2018-06-02 15:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('8', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1013', TO_DATE('2018-06-02 16:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('9', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1083', TO_DATE('2018-06-04 03:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('10', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1007', TO_DATE('2018-06-04 03:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('11', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1005', TO_DATE('2018-06-04 04:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('12', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1007', TO_DATE('2018-06-04 04:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('13', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1010', TO_DATE('2018-06-04 05:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('14', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1009', TO_DATE('2018-06-04 05:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('15', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1009', TO_DATE('2018-06-04 06:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('16', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1015', TO_DATE('2018-06-04 06:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('17', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1005', TO_DATE('2018-06-04 07:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('18', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1043', TO_DATE('2018-06-07 01:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('19', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1016', TO_DATE('2018-06-07 02:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('20', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1020', TO_DATE('2018-06-11 02:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('21', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1006', TO_DATE('2018-06-11 03:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('22', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1006', TO_DATE('2018-06-11 03:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('23', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1003', TO_DATE('2018-06-11 06:00:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('24', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1018', TO_DATE('2018-06-11 07:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('25', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1059', TO_DATE('2018-06-12 11:30:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SCHEDULE_JOB_LOG" VALUES ('26', '1', 'TESTTASK', 'TEST', 'RENREN', '0', NULL, '1049', TO_DATE('2018-06-12 12:00:00', 'YYYY-MM-DD HH24:MI:SS'));

-- ----------------------------
-- TABLE STRUCTURE FOR SYS_CAPTCHA
-- ----------------------------
CREATE TABLE  "SYS_CAPTCHA" (
"UUID" NCHAR(36) NOT NULL ,
"CODE" VARCHAR2(6) NOT NULL ,
"EXPIRE_TIME" DATE NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SYS_CAPTCHA" IS '系统验证码';
COMMENT ON COLUMN  "SYS_CAPTCHA"."UUID" IS 'UUID';
COMMENT ON COLUMN  "SYS_CAPTCHA"."CODE" IS '验证码';
COMMENT ON COLUMN  "SYS_CAPTCHA"."EXPIRE_TIME" IS '过期时间';

-- ----------------------------
-- RECORDS OF SYS_CAPTCHA
-- ----------------------------
INSERT INTO  "SYS_CAPTCHA" VALUES ('0E213AD0-49B1-4424-8A85-5180DFA6CC5B', 'FNE2E', TO_DATE('2018-06-02 15:03:36', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('111DCA52-9B24-4D71-8BA4-46BE61C7F5BE', 'YNN3A', TO_DATE('2018-06-02 06:14:34', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('23C9A9D7-A4BC-4EB6-86E3-D57BCFE97DFB', 'N285M', TO_DATE('2018-06-07 01:22:30', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('2C63ABA8-FC06-44A9-846C-A76235434228', 'GNM3N', TO_DATE('2018-06-07 01:38:04', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('32B48123-0118-4971-8EA7-0F9912ACB0D6', 'M238M', TO_DATE('2018-06-02 15:01:57', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('3DC04364-A853-4D37-88A6-AA970EB07ED9', 'PFPCM', TO_DATE('2018-06-11 02:06:37', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('772F88DC-A331-4F61-8F05-24EF00BA670D', 'PAM5B', TO_DATE('2018-05-31 07:49:59', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('7B3775B6-0C47-4942-81C0-32B161690AF6', 'EBNXD', TO_DATE('2018-06-02 06:14:34', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('7C40CC94-28F1-40A2-80CB-90EC681BB05E', 'FND78', TO_DATE('2018-06-02 15:03:58', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('8A6E5A1E-EA4A-422E-8FD9-FF335763F47C', '7Y876', TO_DATE('2018-06-02 14:59:23', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('8D1364B5-C008-4AA6-8138-662BECF48178', 'NY4YE', TO_DATE('2018-06-02 14:59:24', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('A8770894-281D-4E36-86D2-5D6F774635AC', '24NFG', TO_DATE('2018-06-02 06:14:33', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('AC0324E2-F343-4359-8B6F-42B2DA07C0DD', 'EXPN5', TO_DATE('2018-06-07 01:37:45', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('E162C58B-4FC8-48ED-80CC-05B9EECE41A2', 'ABWNX', TO_DATE('2018-06-02 15:03:08', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('E7B6F8C0-23BA-4D2F-8701-927D283CAC5D', '4W764', TO_DATE('2018-06-02 15:00:10', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('EB1A14D4-EA87-4979-89C2-516BB925967C', 'E3AF7', TO_DATE('2018-05-31 07:50:00', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('ED37D768-ADF4-4C05-8378-8D70B96A26BF', 'Y8NM2', TO_DATE('2018-06-02 15:03:59', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_CAPTCHA" VALUES ('F3FC19BE-6BB2-487D-8DFB-543A8C74445A', 'YDWM5', TO_DATE('2018-06-01 08:30:03', 'YYYY-MM-DD HH24:MI:SS'));

-- ----------------------------
-- TABLE STRUCTURE FOR SYS_CONFIG
-- ----------------------------
CREATE TABLE  "SYS_CONFIG" (
"ID" NUMBER(20) NOT NULL ,
"PARAM_KEY" VARCHAR2(50) NULL ,
"PARAM_VALUE" NCLOB NULL ,
"STATUS" NUMBER(4) NULL ,
"REMARK" VARCHAR2(500) NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SYS_CONFIG" IS '系统配置信息表';
COMMENT ON COLUMN  "SYS_CONFIG"."PARAM_KEY" IS 'KEY';
COMMENT ON COLUMN  "SYS_CONFIG"."PARAM_VALUE" IS 'VALUE';
COMMENT ON COLUMN  "SYS_CONFIG"."STATUS" IS '状态   0：隐藏   1：显示';
COMMENT ON COLUMN  "SYS_CONFIG"."REMARK" IS '备注';

-- ----------------------------
-- RECORDS OF SYS_CONFIG
-- ----------------------------
INSERT INTO  "SYS_CONFIG" VALUES ('1', 'CLOUD_STORAGE_CONFIG_KEY', '{"ALIYUNACCESSKEYID":"","ALIYUNACCESSKEYSECRET":"","ALIYUNBUCKETNAME":"","ALIYUNDOMAIN":"","ALIYUNENDPOINT":"","ALIYUNPREFIX":"","QCLOUDBUCKETNAME":"","QCLOUDDOMAIN":"","QCLOUDPREFIX":"","QCLOUDSECRETID":"","QCLOUDSECRETKEY":"","QINIUACCESSKEY":"NRGMFABZXWLO5B-YYSJOE8-AZ1EISDI1Z3UBLOEZ","QINIUBUCKETNAME":"IOS-APP","QINIUDOMAIN":"HTTP://7XQBWH.DL1.Z0.GLB.CLOUDDN.COM","QINIUPREFIX":"UPLOAD","QINIUSECRETKEY":"UIWJHEVMRWU0VLXFVGY0TACODGQASDTVLJKDY6VV","TYPE":1}', '0', '云存储配置信息');

-- ----------------------------
-- TABLE STRUCTURE FOR SYS_LOG
-- ----------------------------
CREATE TABLE  "SYS_LOG" (
"ID" NUMBER(20) NOT NULL ,
"USERNAME" VARCHAR2(50) NULL ,
"OPERATION" VARCHAR2(50) NULL ,
"METHOD" VARCHAR2(200) NULL ,
"PARAMS" NCLOB NULL ,
"TIME" NUMBER(20) NOT NULL ,
"IP" VARCHAR2(64) NULL ,
"CREATE_DATE" DATE NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SYS_LOG" IS '系统日志';
COMMENT ON COLUMN  "SYS_LOG"."USERNAME" IS '用户名';
COMMENT ON COLUMN  "SYS_LOG"."OPERATION" IS '用户操作';
COMMENT ON COLUMN  "SYS_LOG"."METHOD" IS '请求方法';
COMMENT ON COLUMN  "SYS_LOG"."PARAMS" IS '请求参数';
COMMENT ON COLUMN  "SYS_LOG"."TIME" IS '执行时长(毫秒)';
COMMENT ON COLUMN  "SYS_LOG"."IP" IS 'IP地址';
COMMENT ON COLUMN  "SYS_LOG"."CREATE_DATE" IS '创建时间';

-- ----------------------------
-- RECORDS OF SYS_LOG
-- ----------------------------
INSERT INTO  "SYS_LOG" VALUES ('1', 'ADMIN', '保存菜单', 'IO.RENREN.MODULES.SYS.CONTROLLER.SYSMENUCONTROLLER.SAVE()', '{"MENUID":31,"PARENTID":0,"NAME":"纪律审查","TYPE":0,"ICON":"MENU","ORDERNUM":1}', '107', '0:0:0:0:0:0:0:1', TO_DATE('2018-06-07 01:38:02', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_LOG" VALUES ('2', 'ADMIN', '保存菜单', 'IO.RENREN.MODULES.SYS.CONTROLLER.SYSMENUCONTROLLER.SAVE()', '{"MENUID":32,"PARENTID":31,"NAME":"信访台账","URL":"/","PERMS":"USE:LIST","TYPE":1,"ICON":"ZHEDIE","ORDERNUM":0}', '72', '0:0:0:0:0:0:0:1', TO_DATE('2018-06-07 01:40:01', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_LOG" VALUES ('3', 'ADMIN', '修改菜单', 'IO.RENREN.MODULES.SYS.CONTROLLER.SYSMENUCONTROLLER.UPDATE()', '{"MENUID":32,"PARENTID":31,"NAME":"信访台账","URL":"LETTERCALL","PERMS":"USE:LIST","TYPE":1,"ICON":"ZHEDIE","ORDERNUM":0}', '98', '0:0:0:0:0:0:0:1', TO_DATE('2018-06-07 01:46:02', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_LOG" VALUES ('4', 'ADMIN', '修改菜单', 'IO.RENREN.MODULES.SYS.CONTROLLER.SYSMENUCONTROLLER.UPDATE()', '{"MENUID":32,"PARENTID":31,"NAME":"信访台账","URL":"/LETTERCALL/ACCOUNT","PERMS":"USE:LIST","TYPE":1,"ICON":"ZHEDIE","ORDERNUM":0}', '70', '0:0:0:0:0:0:0:1', TO_DATE('2018-06-11 03:31:24', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_LOG" VALUES ('5', 'ADMIN', '修改菜单', 'IO.RENREN.MODULES.SYS.CONTROLLER.SYSMENUCONTROLLER.UPDATE()', '{"MENUID":32,"PARENTID":31,"NAME":"信访台账","URL":"HTTP://SPORTS.SINA.COM.CN/ZZ/2018-06-11/DOC-IHCUFQIF6847020.SHTML","PERMS":"USE:LIST","TYPE":1,"ICON":"ZHEDIE","ORDERNUM":0}', '91', '0:0:0:0:0:0:0:1', TO_DATE('2018-06-11 03:39:54', 'YYYY-MM-DD HH24:MI:SS'));
INSERT INTO  "SYS_LOG" VALUES ('6', 'ADMIN', '修改菜单', 'IO.RENREN.MODULES.SYS.CONTROLLER.SYSMENUCONTROLLER.UPDATE()', '{"MENUID":32,"PARENTID":31,"NAME":"信访台账","URL":"/LETTERCALL/ACCOUNT","PERMS":"USE:LIST","TYPE":1,"ICON":"ZHEDIE","ORDERNUM":0}', '38', '0:0:0:0:0:0:0:1', TO_DATE('2018-06-11 03:40:29', 'YYYY-MM-DD HH24:MI:SS'));

-- ----------------------------
-- TABLE STRUCTURE FOR SYS_MENU
-- ----------------------------
CREATE TABLE  "SYS_MENU" (
"MENU_ID" NUMBER(20) NOT NULL ,
"PARENT_ID" NUMBER(20) NULL ,
"NAME" VARCHAR2(50) NULL ,
"URL" VARCHAR2(200) NULL ,
"PERMS" VARCHAR2(500) NULL ,
"TYPE" NUMBER(11) NULL ,
"ICON" VARCHAR2(50) NULL ,
"ORDER_NUM" NUMBER(11) NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SYS_MENU" IS '菜单管理';
COMMENT ON COLUMN  "SYS_MENU"."PARENT_ID" IS '父菜单ID，一级菜单为0';
COMMENT ON COLUMN  "SYS_MENU"."NAME" IS '菜单名称';
COMMENT ON COLUMN  "SYS_MENU"."URL" IS '菜单URL';
COMMENT ON COLUMN  "SYS_MENU"."PERMS" IS '授权(多个用逗号分隔，如：USER:LIST,USER:CREATE)';
COMMENT ON COLUMN  "SYS_MENU"."TYPE" IS '类型   0：目录   1：菜单   2：按钮';
COMMENT ON COLUMN  "SYS_MENU"."ICON" IS '菜单图标';
COMMENT ON COLUMN  "SYS_MENU"."ORDER_NUM" IS '排序';

-- ----------------------------
-- RECORDS OF SYS_MENU
-- ----------------------------
INSERT INTO  "SYS_MENU" VALUES ('1', '0', '系统管理', NULL, NULL, '0', 'SYSTEM', '0');
INSERT INTO  "SYS_MENU" VALUES ('2', '1', '管理员列表', 'sys/user', NULL, '1', 'ADMIN', '1');
INSERT INTO  "SYS_MENU" VALUES ('3', '1', '角色管理', 'sys/role', NULL, '1', 'ROLE', '2');
INSERT INTO  "SYS_MENU" VALUES ('4', '1', '菜单管理', 'sys/menu', NULL, '1', 'MENU', '3');
INSERT INTO  "SYS_MENU" VALUES ('5', '1', 'SQL监控', 'http://localhost:8080/renren-fast/druid/sql.html', NULL, '1', 'SQL', '4');
INSERT INTO  "SYS_MENU" VALUES ('6', '1', '定时任务', 'job/schedule', NULL, '1', 'JOB', '5');
INSERT INTO  "SYS_MENU" VALUES ('7', '6', '查看', NULL, 'sys:schedule:list,sys:schedule:info', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('8', '6', '新增', NULL, 'sys:schedule:save', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('9', '6', '修改', NULL, 'sys:schedule:update', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('10', '6', '删除', NULL, 'sys:schedule:delete', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('11', '6', '暂停', NULL, 'sys:schedule:pause', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('12', '6', '恢复', NULL, 'sys:schedule:resume', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('13', '6', '立即执行', NULL, 'sys:schedule:run', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('14', '6', '日志列表', NULL, 'sys:schedule:log', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('15', '2', '查看', NULL, 'sys:user:list,sys:user:info', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('16', '2', '新增', NULL, 'sys:user:save,sys:role:select', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('17', '2', '修改', NULL, 'sys:user:update,sys:role:select', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('18', '2', '删除', NULL, 'sys:user:delete', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('19', '3', '查看', NULL, 'sys:role:list,sys:role:info', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('20', '3', '新增', NULL, 'sys:role:save,sys:menu:list', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('21', '3', '修改', NULL, 'sys:role:update,sys:menu:list', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('22', '3', '删除', NULL, 'sys:role:delete', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('23', '4', '查看', NULL, 'sys:menu:list,sys:menu:info', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('24', '4', '新增', NULL, 'sys:menu:save,sys:menu:select', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('25', '4', '修改', NULL, 'sys:menu:update,sys:menu:select', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('26', '4', '删除', NULL, 'sys:menu:delete', '2', NULL, '0');
INSERT INTO  "SYS_MENU" VALUES ('27', '1', '参数管理', 'sys/config', 'sys:config:list,sys:config:info,sys:config:save,sys:config:update,sys:config:delete', '1', 'config', '6');
INSERT INTO  "SYS_MENU" VALUES ('29', '1', '系统日志', 'sys/log', 'sys:log:list', '1', 'LOG', '7');
INSERT INTO  "SYS_MENU" VALUES ('30', '1', '文件上传', 'oss/oss', 'sys:oss:all', '1', 'OSS', '6');
INSERT INTO  "SYS_MENU" VALUES ('31', '0', '纪律审查', NULL, NULL, '0', 'menu', '1');
INSERT INTO  "SYS_MENU" VALUES ('32', '31', '信访台账', '/lettercall/account', 'use:list', '1', 'zhedie', '0');

-- ----------------------------
-- TABLE STRUCTURE FOR SYS_OSS
-- ----------------------------
CREATE TABLE  "SYS_OSS" (
"ID" NUMBER(20) NOT NULL ,
"URL" VARCHAR2(200) NULL ,
"CREATE_DATE" DATE NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SYS_OSS" IS '文件上传';
COMMENT ON COLUMN  "SYS_OSS"."URL" IS 'URL地址';
COMMENT ON COLUMN  "SYS_OSS"."CREATE_DATE" IS '创建时间';

-- ----------------------------
-- RECORDS OF SYS_OSS
-- ----------------------------

-- ----------------------------
-- TABLE STRUCTURE FOR SYS_ROLE
-- ----------------------------
CREATE TABLE  "SYS_ROLE" (
"ROLE_ID" NUMBER(20) NOT NULL ,
"ROLE_NAME" VARCHAR2(100) NULL ,
"REMARK" VARCHAR2(100) NULL ,
"CREATE_USER_ID" NUMBER(20) NULL ,
"CREATE_TIME" DATE NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SYS_ROLE" IS '角色';
COMMENT ON COLUMN  "SYS_ROLE"."ROLE_NAME" IS '角色名称';
COMMENT ON COLUMN  "SYS_ROLE"."REMARK" IS '备注';
COMMENT ON COLUMN  "SYS_ROLE"."CREATE_USER_ID" IS '创建者ID';
COMMENT ON COLUMN  "SYS_ROLE"."CREATE_TIME" IS '创建时间';

-- ----------------------------
-- RECORDS OF SYS_ROLE
-- ----------------------------

-- ----------------------------
-- TABLE STRUCTURE FOR SYS_ROLE_MENU
-- ----------------------------
CREATE TABLE  "SYS_ROLE_MENU" (
"ID" NUMBER(20) NOT NULL ,
"ROLE_ID" NUMBER(20) NULL ,
"MENU_ID" NUMBER(20) NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SYS_ROLE_MENU" IS '角色与菜单对应关系';
COMMENT ON COLUMN  "SYS_ROLE_MENU"."ROLE_ID" IS '角色ID';
COMMENT ON COLUMN  "SYS_ROLE_MENU"."MENU_ID" IS '菜单ID';

-- ----------------------------
-- RECORDS OF SYS_ROLE_MENU
-- ----------------------------

-- ----------------------------
-- TABLE STRUCTURE FOR SYS_USER
-- ----------------------------
CREATE TABLE  "SYS_USER" (
"USER_ID" NUMBER(20) NOT NULL ,
"USERNAME" VARCHAR2(50) NOT NULL ,
"PASSWORD" VARCHAR2(100) NULL ,
"SALT" VARCHAR2(20) NULL ,
"EMAIL" VARCHAR2(100) NULL ,
"MOBILE" VARCHAR2(100) NULL ,
"STATUS" NUMBER(4) NULL ,
"CREATE_USER_ID" NUMBER(20) NULL ,
"CREATE_TIME" DATE NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SYS_USER" IS '系统用户';
COMMENT ON COLUMN  "SYS_USER"."USERNAME" IS '用户名';
COMMENT ON COLUMN  "SYS_USER"."PASSWORD" IS '密码';
COMMENT ON COLUMN  "SYS_USER"."SALT" IS '盐';
COMMENT ON COLUMN  "SYS_USER"."EMAIL" IS '邮箱';
COMMENT ON COLUMN  "SYS_USER"."MOBILE" IS '手机号';
COMMENT ON COLUMN  "SYS_USER"."STATUS" IS '状态  0：禁用   1：正常';
COMMENT ON COLUMN  "SYS_USER"."CREATE_USER_ID" IS '创建者ID';
COMMENT ON COLUMN  "SYS_USER"."CREATE_TIME" IS '创建时间';

-- ----------------------------
-- RECORDS OF SYS_USER
-- ----------------------------
INSERT INTO  "SYS_USER" VALUES ('1', 'admin', '9ec9750e709431dad22365cabc5c625482e574c74adaebba7dd02f1129e4ce1d', 'YzcmCZNvbXocrsz9dm8e', 'root@renren.io', '13612345678', '1', '1', TO_DATE('2016-11-11 11:11:11', 'YYYY-MM-DD HH24:MI:SS'));

-- ----------------------------
-- TABLE STRUCTURE FOR SYS_USER_ROLE
-- ----------------------------
CREATE TABLE  "SYS_USER_ROLE" (
"ID" NUMBER(20) NOT NULL ,
"USER_ID" NUMBER(20) NULL ,
"ROLE_ID" NUMBER(20) NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SYS_USER_ROLE" IS '用户与角色对应关系';
COMMENT ON COLUMN  "SYS_USER_ROLE"."USER_ID" IS '用户ID';
COMMENT ON COLUMN  "SYS_USER_ROLE"."ROLE_ID" IS '角色ID';

-- ----------------------------
-- RECORDS OF SYS_USER_ROLE
-- ----------------------------

-- ----------------------------
-- TABLE STRUCTURE FOR SYS_USER_TOKEN
-- ----------------------------
CREATE TABLE  "SYS_USER_TOKEN" (
"USER_ID" NUMBER(20) NOT NULL ,
"TOKEN" VARCHAR2(100) NOT NULL ,
"EXPIRE_TIME" DATE NULL ,
"UPDATE_TIME" DATE NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "SYS_USER_TOKEN" IS '系统用户TOKEN';
COMMENT ON COLUMN  "SYS_USER_TOKEN"."TOKEN" IS 'TOKEN';
COMMENT ON COLUMN  "SYS_USER_TOKEN"."EXPIRE_TIME" IS '过期时间';
COMMENT ON COLUMN  "SYS_USER_TOKEN"."UPDATE_TIME" IS '更新时间';


-- ----------------------------
-- TABLE STRUCTURE FOR TB_USER
-- ----------------------------
CREATE TABLE  "TB_USER" (
"USER_ID" NUMBER(20) NOT NULL ,
"USERNAME" VARCHAR2(50) NOT NULL ,
"MOBILE" VARCHAR2(20) NOT NULL ,
"PASSWORD" VARCHAR2(64) NULL ,
"CREATE_TIME" DATE NULL
)
LOGGING
NOCOMPRESS
NOCACHE

;
COMMENT ON TABLE  "TB_USER" IS '用户';
COMMENT ON COLUMN  "TB_USER"."USERNAME" IS '用户名';
COMMENT ON COLUMN  "TB_USER"."MOBILE" IS '手机号';
COMMENT ON COLUMN  "TB_USER"."PASSWORD" IS '密码';
COMMENT ON COLUMN  "TB_USER"."CREATE_TIME" IS '创建时间';

-- ----------------------------
-- RECORDS OF TB_USER
-- ----------------------------
INSERT INTO  "TB_USER" VALUES ('1', 'mark', '13612345678', '8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918', TO_DATE('2017-03-23 22:37:41', 'YYYY-MM-DD HH24:MI:SS'));

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SCHEDULE_JOB
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SCHEDULE_JOB
-- ----------------------------
ALTER TABLE  "SCHEDULE_JOB" ADD CHECK ("JOB_ID" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SCHEDULE_JOB
-- ----------------------------
ALTER TABLE  "SCHEDULE_JOB" ADD PRIMARY KEY ("JOB_ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SCHEDULE_JOB_LOG
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SCHEDULE_JOB_LOG
-- ----------------------------
ALTER TABLE  "SCHEDULE_JOB_LOG" ADD CHECK ("LOG_ID" IS NOT NULL);
ALTER TABLE  "SCHEDULE_JOB_LOG" ADD CHECK ("JOB_ID" IS NOT NULL);
ALTER TABLE  "SCHEDULE_JOB_LOG" ADD CHECK ("STATUS" IS NOT NULL);
ALTER TABLE  "SCHEDULE_JOB_LOG" ADD CHECK ("TIMES" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SCHEDULE_JOB_LOG
-- ----------------------------
ALTER TABLE  "SCHEDULE_JOB_LOG" ADD PRIMARY KEY ("LOG_ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SYS_CAPTCHA
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SYS_CAPTCHA
-- ----------------------------
ALTER TABLE  "SYS_CAPTCHA" ADD CHECK ("UUID" IS NOT NULL);
ALTER TABLE  "SYS_CAPTCHA" ADD CHECK ("CODE" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SYS_CAPTCHA
-- ----------------------------
ALTER TABLE  "SYS_CAPTCHA" ADD PRIMARY KEY ("UUID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SYS_CONFIG
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SYS_CONFIG
-- ----------------------------
ALTER TABLE  "SYS_CONFIG" ADD CHECK ("ID" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SYS_CONFIG
-- ----------------------------
ALTER TABLE  "SYS_CONFIG" ADD PRIMARY KEY ("ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SYS_LOG
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SYS_LOG
-- ----------------------------
ALTER TABLE  "SYS_LOG" ADD CHECK ("ID" IS NOT NULL);
ALTER TABLE  "SYS_LOG" ADD CHECK ("TIME" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SYS_LOG
-- ----------------------------
ALTER TABLE  "SYS_LOG" ADD PRIMARY KEY ("ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SYS_MENU
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SYS_MENU
-- ----------------------------
ALTER TABLE  "SYS_MENU" ADD CHECK ("MENU_ID" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SYS_MENU
-- ----------------------------
ALTER TABLE  "SYS_MENU" ADD PRIMARY KEY ("MENU_ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SYS_OSS
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SYS_OSS
-- ----------------------------
ALTER TABLE  "SYS_OSS" ADD CHECK ("ID" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SYS_OSS
-- ----------------------------
ALTER TABLE  "SYS_OSS" ADD PRIMARY KEY ("ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SYS_ROLE
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SYS_ROLE
-- ----------------------------
ALTER TABLE  "SYS_ROLE" ADD CHECK ("ROLE_ID" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SYS_ROLE
-- ----------------------------
ALTER TABLE  "SYS_ROLE" ADD PRIMARY KEY ("ROLE_ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SYS_ROLE_MENU
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SYS_ROLE_MENU
-- ----------------------------
ALTER TABLE  "SYS_ROLE_MENU" ADD CHECK ("ID" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SYS_ROLE_MENU
-- ----------------------------
ALTER TABLE  "SYS_ROLE_MENU" ADD PRIMARY KEY ("ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SYS_USER
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SYS_USER
-- ----------------------------
ALTER TABLE  "SYS_USER" ADD CHECK ("USER_ID" IS NOT NULL);
ALTER TABLE  "SYS_USER" ADD CHECK ("USERNAME" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SYS_USER
-- ----------------------------
ALTER TABLE  "SYS_USER" ADD PRIMARY KEY ("USER_ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SYS_USER_ROLE
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SYS_USER_ROLE
-- ----------------------------
ALTER TABLE  "SYS_USER_ROLE" ADD CHECK ("ID" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SYS_USER_ROLE
-- ----------------------------
ALTER TABLE  "SYS_USER_ROLE" ADD PRIMARY KEY ("ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE SYS_USER_TOKEN
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE SYS_USER_TOKEN
-- ----------------------------
ALTER TABLE  "SYS_USER_TOKEN" ADD CHECK ("USER_ID" IS NOT NULL);
ALTER TABLE  "SYS_USER_TOKEN" ADD CHECK ("TOKEN" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE SYS_USER_TOKEN
-- ----------------------------
ALTER TABLE  "SYS_USER_TOKEN" ADD PRIMARY KEY ("USER_ID");

-- ----------------------------
-- INDEXES STRUCTURE FOR TABLE TB_USER
-- ----------------------------

-- ----------------------------
-- CHECKS STRUCTURE FOR TABLE TB_USER
-- ----------------------------
ALTER TABLE  "TB_USER" ADD CHECK ("USER_ID" IS NOT NULL);
ALTER TABLE  "TB_USER" ADD CHECK ("USERNAME" IS NOT NULL);
ALTER TABLE  "TB_USER" ADD CHECK ("MOBILE" IS NOT NULL);

-- ----------------------------
-- PRIMARY KEY STRUCTURE FOR TABLE TB_USER
-- ----------------------------
ALTER TABLE  "TB_USER" ADD PRIMARY KEY ("USER_ID");

-- ----------------------------
-- SYS_** 的自增主键序列  和  创建触发器
-- ----------------------------

create sequence user_id_seq increment by 1 start with 2 nomaxvalue nominvalue nocache;

create sequence config_id_seq increment by 1 start with 2 nomaxvalue nominvalue nocache;

create sequence log_id_seq increment by 1 start with 1 nomaxvalue nominvalue nocache;

create sequence menu_id_seq increment by 1 start with 33 nomaxvalue nominvalue nocache;

create sequence oss_id_seq increment by 1 start with 1 nomaxvalue nominvalue nocache;

create sequence role_id_seq increment by 1 start with 1 nomaxvalue nominvalue nocache;

create sequence role_menu_id_seq increment by 1 start with 1 nomaxvalue nominvalue nocache;

create sequence user_role_id_seq increment by 1 start with 1 nomaxvalue nominvalue nocache;

create sequence schedule_job_id_seq increment by 1 start with 3 nomaxvalue nominvalue nocache;

create sequence schedule_job_log_id_seq increment by 1 start with 30 nomaxvalue nominvalue nocache;

create or replace trigger tr_sys_user before insert on SYS_USER for each row
begin
select user_id_seq.nextval into :new.USER_ID from dual;
end;

create or replace trigger tr_sys_config before insert on SYS_CONFIG for each row
begin
select config_id_seq.nextval into :new.ID from dual;
end;

create or replace trigger tr_sys_log before insert on SYS_LOG for each row
begin
select log_id_seq.nextval into :new.ID from dual;
end;

create or replace trigger tr_sys_menu before insert on SYS_MENU for each row
begin
select menu_id_seq.nextval into :new.MENU_ID from dual;
end;

create or replace trigger tr_sys_oss before insert on SYS_OSS for each row
begin
select oss_id_seq.nextval into :new.ID from dual;
end;

create or replace trigger tr_sys_role before insert on SYS_ROLE for each row
begin
select role_id_seq.nextval into :new.ROLE_ID from dual;
end;

create or replace trigger tr_sys_role_menu before insert on SYS_ROLE_MENU for each row
begin
select role_menu_id_seq.nextval into :new.ID from dual;
end;

create or replace trigger tr_sys_role_user before insert on SYS_USER_ROLE for each row
begin
select user_role_id_seq.nextval into :new.ID from dual;
end;

create or replace trigger tr_schedule_job before insert on SCHEDULE_JOB for each row
begin
select schedule_job_id_seq.nextval into :new.JOB_ID from dual;
end;

create or replace trigger tr_schedule_job_log before insert on SCHEDULE_JOB_LOG for each row
begin
select schedule_job_log_id_seq.nextval into :new.LOG_ID from dual;
end;